{literal}
<h2>Annotation</h2>
@orm plugin SimpleOrder( groupPropertyName, step )<br>
<br>
<b>groupPropertyNames</b> - Property names that are used for grouping values in table.<br />
<b>Step</b> - Leaves space between order values. For example step=5 means that order values will be 5,10,15,etc... Default step value is 10.<br>

<h2>Sample definitions</h2>
<pre class="code">
&lt;?php
// @orm plugin SimpleOrder(null,5)

// @orm plugin SimpleOrder(parent)

// @orm plugin SimpleOrder({parent,groupName,otherColumnName},40)

?&gt;
</pre>


<h2>Using</h2>
<pre class="code">
&lt;?php
class MyClass extends DomArObject {
	/**
	* @orm text
	*/
	public $name;
	/**
	* @orm char(25)
	*/		
	public $group = 'default';
	/**
	* @orm plugin SimpleOrder( group, 1 )
	*/
	public $order;
}

// USING

$a = new MyClass();
$b = new MyClass();
$c = new MyClass();

$a->save();
$b->save();
$c->save();

// some operations

$prev = $b->order->getPrev(); // $a

$next = $b->order->getNext(); // $c

$prevCount = $b->order->countPrev(); // 1

$nextCount = $a->order->countNext(); // 2


// Modifications

// our items order is currently a,b,c
// now we will start to alter that order.

$a->order->increase(); // order will be b,a,c

$c->order->decrease(); // order will be b,c,a

$a->order->toMin(); // order will be a,b,c

$a->order->toMax(); // order will be b,c,a

$a->order->setPos(10); // order will be b,c,a, but order values are b-1,c-2,a-10

// to reset these values
$a->order->resetValues(); // now order values are b-1,c-2,a-3

// A will request new order value and will be moved to last.
$c->order->reset(); // b-1,a-3,c-4


?&gt;
</pre>

<h2>If order groups can change</h2>
If order groups can change there is a change that some order values might overlap. To avoid this research this example:<br>
<pre class="code">
&lt;?php
class MyClass extends DomArObject {
	/**
	* @orm text
	*/
	public $name;
	/**
	* @orm char(25)
	* @orm listener afterSet afterSetGroup
	*/		
	public $group = 'default';
	/**
	* @orm plugin SimpleOrder( group )
	*/
	public $order;
	
	public function afterSetGroup() {
		$this->order->reset(); // this will reset element order position and move it to last element.
	}
}

// USING

$a = new MyClass();
$b = new MyClass();
$c = new MyClass();
$d = new MyClass();
$d->group = 'second';
$e = new MyClass();
$e->group = 'second';

$a->save();
$b->save();
$c->save();
$d->save();
$e->save();
// default group elements: A,B,C (in order)
// second group elements: D,E (in order)


$c->group = 'second';
// default group elements: A,B (in order)
// second group elements: D,E,C (in order)

?&gt;
</pre>
{/literal}